var erasePhone_timer = null;
var eraseMessage_timer = null;

function activateHiding(id, parent_id) {
	var e = document.getElementById(id);
	var p = document.getElementById(parent_id);
	
	//p.onmousemove = 'document.getElementById("' + id + '").style.display = "block";';	
}

function doErase(eraser, field) {
	document.getElementById(eraser).style.display = "none";
	
	var field = document.getElementById(field);
	field.value = "";
	if(field.onchange) field.onchange();
}

function hideEraser(eraser) {
	document.getElementById(eraser).style.display = "none";	
}

function delayedRemove(eraser) {
	var dohide = "document.getElementById(\"" + eraser + "\").style.display = \"none\";";
	document.getElementById(eraser).etimer = setTimeout(dohide, 950);
}

function showEraser(eraser, field) {
	var e = document.getElementById(eraser);
	if(document.getElementById(field).value.length > 0) {
		e.style.display = "block";
	}
	if(e.etimer) clearTimeout(e.etimer);	
	delayedRemove(eraser);
}